home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 2
/
AACD 2.iso
/
AACD
/
Magazine
/
GraphicsCards
/
StormMesa
/
src
/
blend.s
< prev
next >
Wrap
Text File
|
1999-02-04
|
34KB
|
1,884 lines
; Storm C Compiler
; Work2:Mesa3/Mesa-3.0/src/blend.c
mc68030
mc68881
XREF _gl_read_rgba_span
XREF _gl_error
XREF _gl_problem
XREF _gl_read_alpha_pixels
XREF _CC
SECTION "_gl_BlendFunc:0",CODE
;void gl_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor )
XDEF _gl_BlendFunc
_gl_BlendFunc
move.l d2,-(a7)
move.l $10(a7),d0
move.l $C(a7),d1
move.l $8(a7),a0
L108
; if (INSIDE_BEGIN_END(ctx))
move.l a0,a1
add.l #$E968,a1
move.l (a1),d2
cmp.l #$1A00,d2
beq.b L110
L109
; gl_error( ctx, GL_INVALID_OPERATION, "glBlendFunc" );
move.l #L105,-(a7)
pea $502.w
move.l a0,-(a7)
jsr _gl_error
add.w #$C,a7
move.l (a7)+,d2
rts
L110
; switch (sfactor)
move.l d1,d2
cmp.l #$306,d2
beq.b L111
bgt.b L117
cmp.l #$303,d2
beq.b L111
bgt.b L118
cmp.l #1,d2
beq.b L111
bgt.b L119
cmp.l #0,d2
beq.b L111
bra.b L112
L119
cmp.l #$302,d2
beq.b L111
bra.b L112
L118
cmp.l #$304,d2
beq.b L111
cmp.l #$305,d2
beq.b L111
bra.b L112
L117
cmp.l #$8002,d2
beq.b L111
bgt.b L120
cmp.l #$308,d2
beq.b L111
bgt.b L121
blt.b L111
L121
cmp.l #$8001,d2
beq.b L111
bra.b L112
L120
cmp.l #$8003,d2
beq.b L111
cmp.l #$8004,d2
beq.b L111
bra.b L112
;
L111
; ctx->Color.BlendSrc = sfactor;
move.l d1,$21EE(a0)
;
bra.b L113
L112
; gl_error( ctx, GL_INVALID_ENUM, "glBlendFunc(sfactor)" );
move.l #L106,-(a7)
pea $500.w
move.l a0,-(a7)
jsr _gl_error
add.w #$C,a7
move.l (a7)+,d2
rts
L113
; return;
; switch (dfactor)
move.l d0,d1
cmp.l #$304,d1
beq L114
bgt.b L122
cmp.l #$301,d1
beq L114
bgt.b L123
cmp.l #1,d1
beq L114
bgt.b L124
cmp.l #0,d1
beq.b L114
bra L115
L124
cmp.l #$300,d1
beq.b L114
bra.b L115
L123
cmp.l #$302,d1
beq.b L114
cmp.l #$303,d1
beq.b L114
bra.b L115
L122
cmp.l #$8002,d1
beq.b L114
bgt.b L125
cmp.l #$305,d1
beq.b L114
cmp.l #$8001,d1
beq.b L114
bra.b L115
L125
cmp.l #$8003,d1
beq.b L114
cmp.l #$8004,d1
beq.b L114
bra.b L115
;
L114
; ctx->Color.BlendDst = dfactor;
move.l d0,$21F2(a0)
;
bra.b L116
L115
; gl_error( ctx, GL_INVALID_ENUM, "glBlendFunc(dfactor)" );
move.l #L107,-(a7)
pea $500.w
move.l a0,-(a7)
jsr _gl_error
add.w #$C,a7
move.l (a7)+,d2
rts
L116
; return;
; ctx->Color.BlendFunc = NULL;
clr.l $220A(a0)
; ctx->NewState |= NEW_RASTER_OPS;
move.l a0,a1
add.l #$E960,a1
move.l (a1),d0
or.l #2,d0
add.l #$E960,a0
move.l d0,(a0)
move.l (a7)+,d2
rts
L105
dc.b 'glBlendFunc',0
L107
dc.b 'glBlendFunc(dfactor)',0
L106
dc.b 'glBlendFunc(sfactor)',0
SECTION "_gl_BlendEquation:0",CODE
rts
;void gl_BlendEquation( GLcontext *ctx, GLenum mode )
XDEF _gl_BlendEquation
_gl_BlendEquation
move.l $8(a7),d0
move.l 4(a7),a0
L127
; if (INSIDE_BEGIN_END(ctx))
move.l a0,a1
add.l #$E968,a1
move.l (a1),d1
cmp.l #$1A00,d1
beq.b L129
L128
; gl_error( ctx, GL_INVALID_OPERATION, "glBlendEquation" );
move.l #L126,-(a7)
pea $502.w
move.l a0,-(a7)
jsr _gl_error
add.w #$C,a7
rts
L129
; switch (mode)
move.l d0,d1
cmp.l #$8008,d1
beq.b L130
bgt.b L137
cmp.l #$8006,d1
beq.b L130
bgt.b L138
cmp.l #$BF1,d1
beq.b L130
bra.b L131
L138
bgt.b L130
L137
cmp.l #$800A,d1
beq.b L130
cmp.l #$800B,d1
beq.b L130
bra.b L131
;
L130
; ctx->Color.BlendEquation = mode;
move.l d0,$21F6(a0)
;
bra.b L132
L131
; gl_error( ctx, GL_INVALID_ENUM, "glBlendEquation" );
move.l #L126,-(a7)
pea $500.w
move.l a0,-(a7)
jsr _gl_error
add.w #$C,a7
rts
L132
; return;
; if (mode==GL_LOGIC_OP && ctx->Color.BlendEnabled)
cmp.l #$BF1,d0
bne.b L135
L133
tst.b $21ED(a0)
beq.b L135
L134
; ctx->Color.ColorLogicOpEnabled = GL_TRUE;
move.b #1,$2213(a0)
bra.b L136
L135
; ctx->Color.ColorLogicOpEnabled = GL_FALSE;
clr.b $2213(a0)
L136
; ctx->Color.BlendFunc = NULL;
clr.l $220A(a0)
; ctx->NewState |= NEW_RASTER_OPS;
move.l a0,a1
add.l #$E960,a1
move.l (a1),d0
or.l #2,d0
add.l #$E960,a0
move.l d0,(a0)
rts
L126
dc.b 'glBlendEquation',0
SECTION "_gl_BlendColor:0",CODE
;void gl_BlendColor( GLcontext *ctx, GLclampf red, GLclampf green,
XDEF _gl_BlendColor
_gl_BlendColor
fmovem.x fp2/fp3/fp4,-(a7)
move.l $28(a7),a0
fmove.s $2C(a7),fp0
fmove.s $38(a7),fp1
fmove.s $34(a7),fp2
fmove.s $30(a7),fp3
L139
; ctx->Color.BlendColor[0] = CLAMP( red, 0.0, 1.0 );
fmove.x fp0,fp4
fcmp.d #$.00000000.00000000,fp4
fboge.b L141
L140
fmove.d #$.00000000.00000000,fp0
bra.b L145
L141
fmove.x fp0,fp4
fcmp.d #$.3FF00000.00000000,fp4
fbole.b L143
L142
fmove.d #$.3FF00000.00000000,fp0
L143
L144
L145
fmove.s fp0,$21FA(a0)
; ctx->Color.BlendColor[1] = CLAMP( green, 0.0, 1.0 );
fmove.x fp3,fp0
fcmp.d #$.00000000.00000000,fp0
fboge.b L147
L146
fmove.d #$.00000000.00000000,fp0
bra.b L151
L147
fmove.x fp3,fp0
fcmp.d #$.3FF00000.00000000,fp0
fbole.b L149
L148
fmove.d #$.3FF00000.00000000,fp0
bra.b L150
L149
fmove.x fp3,fp0
L150
L151
lea $21FA(a0),a1
fmove.s fp0,4(a1)
; ctx->Color.BlendColor[2] = CLAMP( blue, 0.0, 1.0 );
fmove.x fp2,fp0
fcmp.d #$.00000000.00000000,fp0
fboge.b L153
L152
fmove.d #$.00000000.00000000,fp0
bra.b L157
L153
fmove.x fp2,fp0
fcmp.d #$.3FF00000.00000000,fp0
fbole.b L155
L154
fmove.d #$.3FF00000.00000000,fp0
bra.b L156
L155
fmove.x fp2,fp0
L156
L157
lea $21FA(a0),a1
fmove.s fp0,$8(a1)
; ctx->Color.BlendColor[3] = CLAMP( alpha, 0.0, 1.0 );
fmove.x fp1,fp0
fcmp.d #$.00000000.00000000,fp0
fboge.b L159
L158
fmove.d #$.00000000.00000000,fp0
bra.b L163
L159
fmove.x fp1,fp0
fcmp.d #$.3FF00000.00000000,fp0
fbole.b L161
L160
fmove.d #$.3FF00000.00000000,fp0
bra.b L162
L161
fmove.x fp1,fp0
L162
L163
lea $21FA(a0),a0
fmove.s fp0,$C(a0)
fmovem.x (a7)+,fp2/fp3/fp4
rts
SECTION "_blend_transparency:0",CODE
;static void blend_transparency( GLcontext *ctx, GLuint n, const GLub
_blend_transparency
L173 EQU -$1C
link a5,#L173
movem.l d2-d7/a2-a4,-(a7)
movem.l $14(a5),a0/a1
move.l $10(a5),a4
L164
; for (i=0;
moveq #0,d0
bra L171
L165
; if (mask[i])
tst.b 0(a4,d0.l)
beq L170
L166
; GLint t = rgba[i][ACOMP];
lea 0(a0,d0.l*4),a2
moveq #0,d5
move.b 3(a2),d5
; if (t == 0)
tst.l d5
bne.b L168
L167
; rgba[i][RCOMP] = dest[i][RCOMP];
move.b 0(a1,d0.l*4),0(a0,d0.l*4)
; rgba[i][GCOMP] = dest[i][GCOMP];
lea 0(a1,d0.l*4),a2
move.b 1(a2),d1
lea 0(a0,d0.l*4),a2
move.b d1,1(a2)
; rgba[i][BCOMP] = dest[i][BCOMP];
lea 0(a1,d0.l*4),a2
move.b 2(a2),d1
lea 0(a0,d0.l*4),a2
move.b d1,2(a2)
; rgba[i][ACOMP] = dest[i][ACOMP];
lea 0(a1,d0.l*4),a2
move.b 3(a2),d1
lea 0(a0,d0.l*4),a2
move.b d1,3(a2)
bra L170
L168
; else if (t == 255)
cmp.l #$FF,d5
beq L170
L169
; GLint s = 255 - t;
move.l #$FF,d1
sub.l d5,d1
move.l d1,d7
; GLint r = (rgba[i][RCOMP] * t + dest[i][RCOMP] * s) >> 8;
moveq #0,d4
move.b 0(a0,d0.l*4),d4
muls.l d5,d4
moveq #0,d1
move.b 0(a1,d0.l*4),d1
muls.l d7,d1
add.l d1,d4
moveq #$8,d1
asr.l d1,d4
; GLint g = (rgba[i][GCOMP] * t + dest[i][GCOMP] * s) >> 8;
lea 0(a0,d0.l*4),a2
moveq #0,d3
move.b 1(a2),d3
muls.l d5,d3
lea 0(a1,d0.l*4),a2
moveq #0,d1
move.b 1(a2),d1
muls.l d7,d1
add.l d1,d3
moveq #$8,d1
asr.l d1,d3
; GLint b = (rgba[i][BCOMP] * t + dest[i][BCOMP] * s) >> 8;
lea 0(a0,d0.l*4),a2
moveq #0,d2
move.b 2(a2),d2
muls.l d5,d2
lea 0(a1,d0.l*4),a2
moveq #0,d1
move.b 2(a2),d1
muls.l d7,d1
add.l d1,d2
moveq #$8,d1
asr.l d1,d2
; GLint a = (rgba[i][ACOMP] * t + dest[i][ACOMP] * s) >> 8;
lea 0(a0,d0.l*4),a2
moveq #0,d1
move.b 3(a2),d1
muls.l d5,d1
lea 0(a1,d0.l*4),a2
moveq #0,d5
move.b 3(a2),d5
muls.l d7,d5
add.l d5,d1
moveq #$8,d5
asr.l d5,d1
; rgba[i][RCOMP] = r;
move.b d4,0(a0,d0.l*4)
; rgba[i][GCOMP] = g;
lea 0(a0,d0.l*4),a2
move.b d3,1(a2)
; rgba[i][BCOMP] = b;
lea 0(a0,d0.l*4),a2
move.b d2,2(a2)
; rgba[i][ACOMP] = a;
lea 0(a0,d0.l*4),a2
move.b d1,3(a2)
L170
addq.l #1,d0
L171
cmp.l $C(a5),d0
blo L165
L172
movem.l (a7)+,d2-d7/a2-a4
unlk a5
rts
SECTION "_blend_add:0",CODE
;static void blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[
_blend_add
movem.l d2-d6/a2-a4,-(a7)
movem.l $28(a7),d6/a4
movem.l $30(a7),a0/a1
L174
; (void) ctx;
; for (i=0;
moveq #0,d0
bra L190
L175
; if (mask[i])
tst.b 0(a4,d0.l)
beq L189
L176
; GLint r = rgba[i][RCOMP] + dest[i][RCOMP];
moveq #0,d4
move.b 0(a0,d0.l*4),d4
moveq #0,d1
move.b 0(a1,d0.l*4),d1
add.l d1,d4
; GLint g = rgba[i][GCOMP] + dest[i][GCOMP];
lea 0(a0,d0.l*4),a2
moveq #0,d3
move.b 1(a2),d3
lea 0(a1,d0.l*4),a2
moveq #0,d1
move.b 1(a2),d1
add.l d1,d3
; GLint b = rgba[i][BCOMP] + dest[i][BCOMP];
lea 0(a0,d0.l*4),a2
moveq #0,d2
move.b 2(a2),d2
lea 0(a1,d0.l*4),a2
moveq #0,d1
move.b 2(a2),d1
add.l d1,d2
; GLint a = rgba[i][ACOMP] + dest[i][ACOMP];
lea 0(a0,d0.l*4),a2
moveq #0,d1
move.b 3(a2),d1
lea 0(a1,d0.l*4),a2
moveq #0,d5
move.b 3(a2),d5
add.l d5,d1
; rgba[i][RCOMP] = MIN2( r, 255 );
cmp.l #$FF,d4
bge.b L178
L177
bra.b L179
L178
move.l #$FF,d4
L179
move.b d4,0(a0,d0.l*4)
; rgba[i][GCOMP] = MIN2( g, 255 );
cmp.l #$FF,d3
bge.b L181
L180
bra.b L182
L181
move.l #$FF,d3
L182
lea 0(a0,d0.l*4),a2
move.b d3,1(a2)
; rgba[i][BCOMP] = MIN2( b, 255 );
cmp.l #$FF,d2
bge.b L184
L183
bra.b L185
L184
move.l #$FF,d2
L185
lea 0(a0,d0.l*4),a2
move.b d2,2(a2)
; rgba[i][ACOMP] = MIN2( a, 255 );
cmp.l #$FF,d1
bge.b L187
L186
bra.b L188
L187
move.l #$FF,d1
L188
lea 0(a0,d0.l*4),a2
move.b d1,3(a2)
L189
addq.l #1,d0
L190
cmp.l d6,d0
blo L175
L191
movem.l (a7)+,d2-d6/a2-a4
rts
SECTION "_blend_min:0",CODE
;static void blend_min( GLcontext *ctx, GLuint n, const GLubyte mask[
_blend_min
movem.l d2/d3/a2-a4,-(a7)
movem.l $1C(a7),d3/a4
movem.l $24(a7),a0/a1
L192
; (void) ctx;
; for (i=0;
moveq #0,d0
bra L208
L193
; if (mask[i])
tst.b 0(a4,d0.l)
beq L207
L194
; rgba[i][RCOMP] = MIN2( rgba[i][RCOMP], dest[i][RCOMP] );
move.b 0(a0,d0.l*4),d2
cmp.b 0(a1,d0.l*4),d2
bhs.b L196
L195
move.b 0(a0,d0.l*4),d1
bra.b L197
L196
move.b 0(a1,d0.l*4),d1
L197
move.b d1,0(a0,d0.l*4)
; rgba[i][GCOMP] = MIN2( rgba[i][GCOMP], dest[i][GCOMP] );
lea 0(a0,d0.l*4),a2
move.b 1(a2),d2
lea 0(a1,d0.l*4),a2
cmp.b 1(a2),d2
bhs.b L199
L198
lea 0(a0,d0.l*4),a2
move.b 1(a2),d1
bra.b L200
L199
lea 0(a1,d0.l*4),a2
move.b 1(a2),d1
L200
lea 0(a0,d0.l*4),a2
move.b d1,1(a2)
; rgba[i][BCOMP] = MIN2( rgba[i][BCOMP], dest[i][BCOMP] );
lea 0(a0,d0.l*4),a2
move.b 2(a2),d2
lea 0(a1,d0.l*4),a2
cmp.b 2(a2),d2
bhs.b L202
L201
lea 0(a0,d0.l*4),a2
move.b 2(a2),d1
bra.b L203
L202
lea 0(a1,d0.l*4),a2
move.b 2(a2),d1
L203
lea 0(a0,d0.l*4),a2
move.b d1,2(a2)
; rgba[i][ACOMP] = MIN2( rgba[i][ACOMP], dest[i][ACOMP] );
lea 0(a0,d0.l*4),a2
move.b 3(a2),d2
lea 0(a1,d0.l*4),a2
cmp.b 3(a2),d2
bhs.b L205
L204
lea 0(a0,d0.l*4),a2
move.b 3(a2),d1
bra.b L206
L205
lea 0(a1,d0.l*4),a2
move.b 3(a2),d1
L206
lea 0(a0,d0.l*4),a2
move.b d1,3(a2)
L207
addq.l #1,d0
L208
cmp.l d3,d0
blo L193
L209
movem.l (a7)+,d2/d3/a2-a4
rts
SECTION "_blend_max:0",CODE
;static void blend_max( GLcontext *ctx, GLuint n, const GLubyte mask[
_blend_max
movem.l d2/d3/a2-a4,-(a7)
movem.l $1C(a7),d3/a4
movem.l $24(a7),a0/a1
L210
; (void) ctx;
; for (i=0;
moveq #0,d0
bra L226
L211
; if (mask[i])
tst.b 0(a4,d0.l)
beq L225
L212
; rgba[i][RCOMP] = MAX2( rgba[i][RCOMP], dest[i][RCOMP] );
move.b 0(a0,d0.l*4),d2
cmp.b 0(a1,d0.l*4),d2
bls.b L214
L213
move.b 0(a0,d0.l*4),d1
bra.b L215
L214
move.b 0(a1,d0.l*4),d1
L215
move.b d1,0(a0,d0.l*4)
; rgba[i][GCOMP] = MAX2( rgba[i][GCOMP], dest[i][GCOMP] );
lea 0(a0,d0.l*4),a2
move.b 1(a2),d2
lea 0(a1,d0.l*4),a2
cmp.b 1(a2),d2
bls.b L217
L216
lea 0(a0,d0.l*4),a2
move.b 1(a2),d1
bra.b L218
L217
lea 0(a1,d0.l*4),a2
move.b 1(a2),d1
L218
lea 0(a0,d0.l*4),a2
move.b d1,1(a2)
; rgba[i][BCOMP] = MAX2( rgba[i][BCOMP], dest[i][BCOMP] );
lea 0(a0,d0.l*4),a2
move.b 2(a2),d2
lea 0(a1,d0.l*4),a2
cmp.b 2(a2),d2
bls.b L220
L219
lea 0(a0,d0.l*4),a2
move.b 2(a2),d1
bra.b L221
L220
lea 0(a1,d0.l*4),a2
move.b 2(a2),d1
L221
lea 0(a0,d0.l*4),a2
move.b d1,2(a2)
; rgba[i][ACOMP] = MAX2( rgba[i][ACOMP], dest[i][ACOMP] );
lea 0(a0,d0.l*4),a2
move.b 3(a2),d2
lea 0(a1,d0.l*4),a2
cmp.b 3(a2),d2
bls.b L223
L222
lea 0(a0,d0.l*4),a2
move.b 3(a2),d1
bra.b L224
L223
lea 0(a1,d0.l*4),a2
move.b 3(a2),d1
L224
lea 0(a0,d0.l*4),a2
move.b d1,3(a2)
L225
addq.l #1,d0
L226
cmp.l d3,d0
blo L211
L227
movem.l (a7)+,d2/d3/a2-a4
rts
SECTION "_blend_modulate:0",CODE
;static void blend_modulate( GLcontext *ctx, GLuint n, const GLubyte
_blend_modulate
movem.l d2-d6/a2-a4,-(a7)
movem.l $28(a7),d6/a4
movem.l $30(a7),a0/a1
L228
; (void) ctx;
; for (i=0;
moveq #0,d0
bra L232
L229
; if (mask[i])
tst.b 0(a4,d0.l)
beq L231
L230
; GLint r = (rgba[i][RCOMP] * dest[i][RCOMP]) >> 8;
moveq #0,d2
move.b 0(a0,d0.l*4),d2
moveq #0,d1
move.b 0(a1,d0.l*4),d1
move.w d2,d4
mulu d1,d4
moveq #$8,d1
lsr.l d1,d4
; GLint g = (rgba[i][GCOMP] * dest[i][GCOMP]) >> 8;
lea 0(a0,d0.l*4),a2
moveq #0,d2
move.b 1(a2),d2
lea 0(a1,d0.l*4),a2
moveq #0,d1
move.b 1(a2),d1
move.w d2,d3
mulu d1,d3
moveq #$8,d1
lsr.l d1,d3
; GLint b = (rgba[i][BCOMP] * dest[i][BCOMP]) >> 8;
lea 0(a0,d0.l*4),a2
moveq #0,d2
move.b 2(a2),d2
lea 0(a1,d0.l*4),a2
moveq #0,d1
move.b 2(a2),d1
mulu d1,d2
moveq #$8,d1
lsr.l d1,d2
; GLint a = (rgba[i][ACOMP] * dest[i][ACOMP]) >> 8;
lea 0(a0,d0.l*4),a2
moveq #0,d5
move.b 3(a2),d5
lea 0(a1,d0.l*4),a2
moveq #0,d1
move.b 3(a2),d1
mulu d5,d1
moveq #$8,d5
lsr.l d5,d1
; rgba[i][RCOMP] = r;
move.b d4,0(a0,d0.l*4)
; rgba[i][GCOMP] = g;
lea 0(a0,d0.l*4),a2
move.b d3,1(a2)
; rgba[i][BCOMP] = b;
lea 0(a0,d0.l*4),a2
move.b d2,2(a2)
; rgba[i][ACOMP] = a;
lea 0(a0,d0.l*4),a2
move.b d1,3(a2)
L231
addq.l #1,d0
L232
cmp.l d6,d0
blo L229
L233
movem.l (a7)+,d2-d6/a2-a4
rts
SECTION "_blend_general:0",CODE
;static void blend_general( GLcontext *ctx, GLuint n, const GLubyte m
_blend_general
L320 EQU -$128
link a5,#L320
movem.l d2-d7/a2-a4,-(a7)
fmovem.x fp2/fp3/fp4/fp5/fp6/fp7,-(a7)
move.l $8(a5),a2
move.l $14(a5),a3
move.l $18(a5),a4
L236
; GLfloat rscale = 1.0F / 255.0F;
move.l #$3B808080,-4(a5)
; GLfloat gscale = 1.0F / 255.0F;
move.l #$3B808080,-$8(a5)
; GLfloat bscale = 1.0F / 255.0F;
move.l #$3B808080,-$C(a5)
; GLfloat ascale = 1.0F / 255.0F;
move.l #$3B808080,-$10(a5)
; for (i=0;
moveq #0,d2
bra L318
L237
; if (mask[i])
move.l $10(a5),a1
tst.b 0(a1,d2.l)
beq L317
L238
; Rs = rgba[i][RCOMP];
moveq #0,d0
move.b 0(a3,d2.l*4),d0
move.l d0,-$18(a5)
; Gs = rgba[i][GCOMP];
lea 0(a3,d2.l*4),a0
moveq #0,d0
move.b 1(a0),d0
move.l d0,-$1C(a5)
; Bs = rgba[i][BCOMP];
lea 0(a3,d2.l*4),a0
moveq #0,d0
move.b 2(a0),d0
move.l d0,-$20(a5)
; As = rgba[i][ACOMP];
lea 0(a3,d2.l*4),a0
moveq #0,d4
move.b 3(a0),d4
; Rd = dest[i][RCOMP];
moveq #0,d7
move.b 0(a4,d2.l*4),d7
; Gd = dest[i][GCOMP];
lea 0(a4,d2.l*4),a0
moveq #0,d6
move.b 1(a0),d6
; Bd = dest[i][BCOMP];
lea 0(a4,d2.l*4),a0
moveq #0,d5
move.b 2(a0),d5
; Ad = dest[i][ACOMP];
lea 0(a4,d2.l*4),a0
moveq #0,d3
move.b 3(a0),d3
; switch (ctx->Color.BlendSrc)
move.l $21EE(a2),d0
cmp.l #$306,d0
beq L241
bgt.b L321
cmp.l #$303,d0
beq L244
bgt.b L322
cmp.l #1,d0
beq L240
bgt.b L323
cmp.l #0,d0
beq.b L239
bra L255
L323
cmp.l #$302,d0
beq L243
bra L255
L322
cmp.l #$304,d0
beq L245
cmp.l #$305,d0
beq L246
bra L255
L321
cmp.l #$8002,d0
beq L252
bgt.b L324
cmp.l #$308,d0
beq L247
bgt.b L325
blt L242
L325
cmp.l #$8001,d0
beq L251
bra L255
L324
cmp.l #$8003,d0
beq L253
cmp.l #$8004,d0
beq L254
bra L255
;
L239
; sR = sG = sB = sA = 0.0F;
fmove.s #$.00000000,fp2
fmove.x fp2,fp3
fmove.x fp2,fp6
fmove.s fp6,-$3C(a5)
;
bra L256
L240
; sR = sG = sB = sA = 1.0F;
fmove.s #$.3F800000,fp2
fmove.x fp2,fp3
fmove.x fp2,fp6
fmove.s fp6,-$3C(a5)
;
bra L256
L241
; sR = (GLfloat) Rd * rscale;
fmove.l d7,fp0
fmul.s -4(a5),fp0
fmove.x fp0,fp6
; sG = (GLfloat) Gd * gscale;
fmove.l d6,fp0
fmove.s fp0,-$3C(a5)
fmove.s -$3C(a5),fp0
fmul.s -$8(a5),fp0
fmove.s fp0,-$3C(a5)
; sB = (GLfloat) Bd * bscale;
fmove.l d5,fp2
fmul.s -$C(a5),fp2
; sA = (GLfloat) Ad * ascale;
fmove.l d3,fp3
fmul.s -$10(a5),fp3
;
bra L256
L242
; sR = 1.0F - (GLfloat) Rd * rscale;
fmove.l d7,fp0
fmul.s -4(a5),fp0
fmove.s #$.3F800000,fp1
fsub.x fp0,fp1
fmove.x fp1,fp6
; sG = 1.0F - (GLfloat) Gd * gscale;
fmove.l d6,fp0
fmul.s -$8(a5),fp0
fmove.s #$.3F800000,fp1
fsub.x fp0,fp1
fmove.s fp1,-$3C(a5)
; sB = 1.0F - (GLfloat) Bd * bscale;
fmove.l d5,fp0
fmul.s -$C(a5),fp0
fmove.s #$.3F800000,fp2
fsub.x fp0,fp2
; sA = 1.0F - (GLfloat) Ad * ascale;
fmove.l d3,fp0
fmul.s -$10(a5),fp0
fmove.s #$.3F800000,fp3
fsub.x fp0,fp3
;
bra L256
L243
; sR = sG = sB = sA = (GLfloat) As * ascale;
fmove.l d4,fp3
fmove.x fp3,fp0
fmul.s -$10(a5),fp0
fmove.x fp0,fp3
fmove.x fp3,fp2
fmove.s fp2,-$3C(a5)
fmove.s -$3C(a5),fp6
;
bra L256
L244
; sR = sG = sB = sA = (GLfloat) 1.0F - (GLfloat) As *
fmove.l d4,fp0
fmul.s -$10(a5),fp0
fmove.s #$.3F800000,fp1
fsub.x fp0,fp1
fmove.x fp1,fp3
fmove.x fp3,fp2
fmove.s fp2,-$3C(a5)
fmove.s -$3C(a5),fp6
;
bra L256
L245
; sR = sG = sB = sA =(GLfloat) Ad * ascale;
fmove.l d3,fp3
fmove.x fp3,fp0
fmul.s -$10(a5),fp0
fmove.x fp0,fp3
fmove.x fp3,fp2
fmove.s fp2,-$3C(a5)
fmove.s -$3C(a5),fp6
;
bra L256
L246
; sR = sG = sB = sA = 1.0F - (GLfloat) Ad * ascale;
fmove.l d3,fp0
fmul.s -$10(a5),fp0
fmove.s #$.3F800000,fp1
fsub.x fp0,fp1
fmove.x fp1,fp3
fmove.x fp3,fp2
fmove.s fp2,-$3C(a5)
fmove.s -$3C(a5),fp6
;
bra L256
L247
; if (As < 1.0F - (GLfloat) Ad * ascale)
fmove.l d4,fp1
fmove.l d3,fp0
fmul.s -$10(a5),fp0
fmove.s #$.3F800000,fp2
fsub.x fp0,fp2
fcmp.x fp2,fp1
fboge.b L249
L248
; sR = sG = sB = (GLfloat) As * ascale;
fmove.l d4,fp2
fmove.x fp2,fp0
fmul.s -$10(a5),fp0
fmove.x fp0,fp2
fmove.s fp2,-$3C(a5)
fmove.s -$3C(a5),fp6
bra.b L250
L249
; sR = sG = sB = 1.0F - (GLfloat) Ad * ascale;
fmove.l d3,fp0
fmul.s -$10(a5),fp0
fmove.s #$.3F800000,fp1
fsub.x fp0,fp1
fmove.x fp1,fp2
fmove.s fp2,-$3C(a5)
fmove.s -$3C(a5),fp6
L250
; sA = 1.0;
fmove.s #$.3F800000,fp3
;
bra L256
L251
; sR = ctx->Color.BlendColor[0];
fmove.s $21FA(a2),fp6
; sG = ctx->Color.BlendColor[1];
lea $21FA(a2),a0
move.l 4(a0),-$3C(a5)
; sB = ctx->Color.BlendColor[2];
lea $21FA(a2),a0
fmove.s $8(a0),fp2
; sA = ctx->Color.BlendColor[3];
lea $21FA(a2),a0
fmove.s $C(a0),fp3
;
bra L256
L252
; sR = 1.0F - ctx->Color.BlendColor[0];
fmove.s #$.3F800000,fp0
fsub.s $21FA(a2),fp0
fmove.x fp0,fp6
; sG = 1.0F - ctx->Color.BlendColor[1];
lea $21FA(a2),a0
fmove.s #$.3F800000,fp0
fsub.s 4(a0),fp0
fmove.s fp0,-$3C(a5)
; sB = 1.0F - ctx->Color.BlendColor[2];
lea $21FA(a2),a0
fmove.s #$.3F800000,fp2
fsub.s $8(a0),fp2
; sA = 1.0F - ctx->Color.BlendColor[3];
lea $21FA(a2),a0
fmove.s #$.3F800000,fp3
fsub.s $C(a0),fp3
;
bra.b L256
L253
; sR = sG = sB = sA = ctx->Color.BlendColor[3];
lea $21FA(a2),a0
fmove.s $C(a0),fp3
fmove.x fp3,fp2
fmove.s fp2,-$3C(a5)
fmove.s -$3C(a5),fp6
;
bra.b L256
L254
; sR = sG = sB = sA = 1.0F - ctx->Color.BlendColor[3];
lea $21FA(a2),a0
fmove.s #$.3F800000,fp0
fsub.s $C(a0),fp0
fmove.x fp0,fp3
fmove.x fp3,fp2
fmove.s fp2,-$3C(a5)
fmove.s -$3C(a5),fp6
;
bra.b L256
L255
; gl_problem(ctx, "Bad blend source factor in do_blend
move.l #L234,-(a7)
move.l a2,-(a7)
jsr _gl_problem
addq.w #$8,a7
L256
; switch (ctx->Color.BlendDst)
move.l $21F2(a2),d0
cmp.l #$304,d0
beq L263
bgt.b L326
cmp.l #$301,d0
beq L260
bgt.b L327
cmp.l #1,d0
beq L258
bgt.b L328
cmp.l #0,d0
beq.b L257
bra L269
L328
cmp.l #$300,d0
beq L259
bra L269
L327
cmp.l #$302,d0
beq L261
cmp.l #$303,d0
beq L262
bra L269
L326
cmp.l #$8002,d0
beq L266
bgt.b L329
cmp.l #$305,d0
beq L264
cmp.l #$8001,d0
beq L265
bra L269
L329
cmp.l #$8003,d0
beq L267
cmp.l #$8004,d0
beq L268
bra L269
;
L257
; dR = dG = dB = dA = 0.0F;
fmove.s #$.00000000,fp4
fmove.x fp4,fp5
fmove.s fp4,fp7
fmove.s fp7,-$4C(a5)
;
bra L270
L258
; dR = dG = dB = dA = 1.0F;
fmove.s #$.3F800000,fp4
fmove.x fp4,fp5
fmove.s fp4,fp7
fmove.s fp7,-$4C(a5)
;
bra L270
L259
; dR = (GLfloat) Rs * rscale;
fmove.l -$18(a5),fp0
fmul.s -4(a5),fp0
fmove.s fp0,fp7
; dG = (GLfloat) Gs * gscale;
fmove.l -$1C(a5),fp0
fmove.s fp0,-$4C(a5)
fmove.s -$4C(a5),fp0
fmul.s -$8(a5),fp0
fmove.s fp0,-$4C(a5)
; dB = (GLfloat) Bs * bscale;
fmove.l -$20(a5),fp4
fmul.s -$C(a5),fp4
; dA = (GLfloat) As * ascale;
fmove.l d4,fp5
fmul.s -$10(a5),fp5
;
bra L270
L260
; dR = 1.0F - (GLfloat) Rs * rscale;
fmove.l -$18(a5),fp0
fmul.s -4(a5),fp0
fmove.s #$.3F800000,fp1
fsub.x fp0,fp1
fmove.s fp1,fp7
; dG = 1.0F - (GLfloat) Gs * gscale;
fmove.l -$1C(a5),fp0
fmul.s -$8(a5),fp0
fmove.s #$.3F800000,fp1
fsub.x fp0,fp1
fmove.s fp1,-$4C(a5)
; dB = 1.0F - (GLfloat) Bs * bscale;
fmove.l -$20(a5),fp0
fmul.s -$C(a5),fp0
fmove.s #$.3F800000,fp4
fsub.x fp0,fp4
; dA = 1.0F - (GLfloat) As * ascale;
fmove.l d4,fp0
fmul.s -$10(a5),fp0
fmove.s #$.3F800000,fp5
fsub.x fp0,fp5
;
bra L270
L261
; dR = dG = dB = dA = (GLfloat) As * ascale;
fmove.l d4,fp5
fmove.x fp5,fp0
fmul.s -$10(a5),fp0
fmove.x fp0,fp5
fmove.x fp5,fp4
fmove.s fp4,-$4C(a5)
fmove.s -$4C(a5),fp7
;
bra L270
L262
; dR = dG = dB = dA = (GLfloat) 1.0F - (GLfloat) As *
fmove.l d4,fp0
fmul.s -$10(a5),fp0
fmove.s #$.3F800000,fp1
fsub.x fp0,fp1
fmove.x fp1,fp5
fmove.x fp5,fp4
fmove.s fp4,-$4C(a5)
fmove.s -$4C(a5),fp7
;
bra L270
L263
; dR = dG = dB = dA = (GLfloat) Ad * ascale;
fmove.l d3,fp5
fmove.x fp5,fp0
fmul.s -$10(a5),fp0
fmove.x fp0,fp5
fmove.x fp5,fp4
fmove.s fp4,-$4C(a5)
fmove.s -$4C(a5),fp7
;
bra L270
L264
; dR = dG = dB = dA = 1.0F - (GLfloat) Ad * ascale;
fmove.l d3,fp0
fmul.s -$10(a5),fp0
fmove.s #$.3F800000,fp1
fsub.x fp0,fp1
fmove.x fp1,fp5
fmove.x fp5,fp4
fmove.s fp4,-$4C(a5)
fmove.s -$4C(a5),fp7
;
bra L270
L265
; dR = ctx->Color.BlendColor[0];
fmove.s $21FA(a2),fp7
; dG = ctx->Color.BlendColor[1];
lea $21FA(a2),a0
move.l 4(a0),-$4C(a5)
; dB = ctx->Color.BlendColor[2];
lea $21FA(a2),a0
fmove.s $8(a0),fp4
; dA = ctx->Color.BlendColor[3];
lea $21FA(a2),a0
fmove.s $C(a0),fp5
;
bra L270
L266
; dR = 1.0F - ctx->Color.BlendColor[0];
fmove.s #$.3F800000,fp0
fsub.s $21FA(a2),fp0
fmove.s fp0,fp7
; dG = 1.0F - ctx->Color.BlendColor[1];
lea $21FA(a2),a0
fmove.s #$.3F800000,fp0
fsub.s 4(a0),fp0
fmove.s fp0,-$4C(a5)
; dB = 1.0F - ctx->Color.BlendColor[2];
lea $21FA(a2),a0
fmove.s #$.3F800000,fp4
fsub.s $8(a0),fp4
; dA = 1.0F - ctx->Color.BlendColor[3];
lea $21FA(a2),a0
fmove.s #$.3F800000,fp5
fsub.s $C(a0),fp5
;
bra.b L270
L267
; dR = dG = dB = dA = ctx->Color.BlendColor[3];
lea $21FA(a2),a0
fmove.s $C(a0),fp5
fmove.x fp5,fp4
fmove.s fp4,-$4C(a5)
fmove.s -$4C(a5),fp7
;
bra.b L270
L268
; dR = dG = dB = dA = 1.0F - ctx->Color.BlendColor[3]
lea $21FA(a2),a0
fmove.s $C(a0),fp0
fmul.s -$10(a5),fp0
fmove.s #$.3F800000,fp1
fsub.x fp0,fp1
fmove.x fp1,fp5
fmove.x fp5,fp4
fmove.s fp4,-$4C(a5)
fmove.s -$4C(a5),fp7
;
bra.b L270
L269
; gl_problem(ctx, "Bad blend dest factor in do_blend");
move.l #L235,-(a7)
move.l a2,-(a7)
jsr _gl_problem
addq.w #$8,a7
L270
; if (dA < 0.0F)
fcmp.s #$.00000000,fp5
fboge.b L272
L271
; if (dA < 0.0F) dA = 0.0F;
fmove.s #$.00000000,fp5
L272
; if (dR < 0.0F)
fmove.x fp7,fp0
fcmp.s #$.00000000,fp0
fboge.b L274
L273
; if (dR < 0.0F) dR = 0.0F;
fmove.s #$.00000000,fp7
L274
; if (dG < 0.0F)
fmove.s -$4C(a5),fp0
fcmp.s #$.00000000,fp0
fboge.b L276
L275
; if (dG < 0.0F) dG = 0.0F;
clr.l -$4C(a5)
L276
; if (dB < 0.0F)
fcmp.s #$.00000000,fp4
fboge.b L278
L277
; if (dB < 0.0F) dB = 0.0F;
fmove.s #$.00000000,fp4
L278
; if (sA < 0.0F)
fcmp.s #$.00000000,fp3
fboge.b L280
L279
; if (sA < 0.0F) sA = 0.0F;
fmove.s #$.00000000,fp3
L280
; if (sR < 0.0F)
fmove.x fp6,fp0
fcmp.s #$.00000000,fp0
fboge.b L282
L281
; if (sR < 0.0F) sR = 0.0F;
fmove.s #$.00000000,fp6
L282
; if (sG < 0.0F)
fmove.s -$3C(a5),fp0
fcmp.s #$.00000000,fp0
fboge.b L284
L283
; if (sG < 0.0F) sG = 0.0F;
clr.l -$3C(a5)
L284
; if (sB < 0.0F)
fcmp.s #$.00000000,fp2
fboge.b L286
L285
; if (sB < 0.0F) sB = 0.0F;
fmove.s #$.00000000,fp2
L286
; if (ctx->Color.BlendEquation==GL_FUNC_ADD_EXT)
move.l $21F6(a2),d0
cmp.l #$8006,d0
bne L288
L287
; r = Rs * sR + Rd * dR;
fmove.l -$18(a5),fp0
fmove.s fp0,-$58(a5)
fmove.s -$58(a5),fp0
fmul.x fp6,fp0
fmove.s fp0,-$58(a5)
fmove.l d7,fp0
fmul.x fp7,fp0
fmove.s -$58(a5),fp1
fadd.x fp0,fp1
fmove.s fp1,-$58(a5)
; g = Gs * sG + Gd * dG;
fmove.l -$1C(a5),fp0
fmove.s fp0,-$5C(a5)
fmove.s -$5C(a5),fp0
fmul.s -$3C(a5),fp0
fmove.s fp0,-$5C(a5)
fmove.l d6,fp0
fmul.s -$4C(a5),fp0
fmove.s -$5C(a5),fp1
fadd.x fp0,fp1
fmove.s fp1,-$5C(a5)
; b = Bs * sB + Bd * dB;
fmove.l -$20(a5),fp0
fmove.s fp0,-$60(a5)
fmove.s -$60(a5),fp0
fmul.x fp2,fp0
fmove.s fp0,-$60(a5)
fmove.l d5,fp0
fmul.x fp4,fp0
fmove.s -$60(a5),fp1
fadd.x fp0,fp1
fmove.s fp1,-$60(a5)
; a = As * sA + Ad * dA;
fmove.l d4,fp0
fmove.s fp0,-$64(a5)
fmove.s -$64(a5),fp0
fmul.x fp3,fp0
fmove.s fp0,-$64(a5)
fmove.l d3,fp0
fmul.x fp5,fp0
fmove.s -$64(a5),fp1
fadd.x fp0,fp1
fmove.s fp1,-$64(a5)
bra L292
L288
; else if (ctx->Color.BlendEquation==GL_FUNC_SUBTRACT_EXT)
move.l $21F6(a2),d0
cmp.l #$800A,d0
bne L290
L289
; r = Rs * sR - Rd * dR;
fmove.l -$18(a5),fp0
fmove.s fp0,-$58(a5)
fmove.s -$58(a5),fp0
fmul.x fp6,fp0
fmove.s fp0,-$58(a5)
fmove.l d7,fp0
fmul.x fp7,fp0
fmove.s -$58(a5),fp1
fsub.x fp0,fp1
fmove.s fp1,-$58(a5)
; g = Gs * sG - Gd * dG;
fmove.l -$1C(a5),fp0
fmove.s fp0,-$5C(a5)
fmove.s -$5C(a5),fp0
fmul.s -$3C(a5),fp0
fmove.s fp0,-$5C(a5)
fmove.l d6,fp0
fmul.s -$4C(a5),fp0
fmove.s -$5C(a5),fp1
fsub.x fp0,fp1
fmove.s fp1,-$5C(a5)
; b = Bs * sB - Bd * dB;
fmove.l -$20(a5),fp0
fmove.s fp0,-$60(a5)
fmove.s -$60(a5),fp0
fmul.x fp2,fp0
fmove.s fp0,-$60(a5)
fmove.l d5,fp0
fmul.x fp4,fp0
fmove.s -$60(a5),fp1
fsub.x fp0,fp1
fmove.s fp1,-$60(a5)
; a = As * sA - Ad * dA;
fmove.l d4,fp0
fmove.s fp0,-$64(a5)
fmove.s -$64(a5),fp0
fmul.x fp3,fp0
fmove.s fp0,-$64(a5)
fmove.l d3,fp0
fmul.x fp5,fp0
fmove.s -$64(a5),fp1
fsub.x fp0,fp1
fmove.s fp1,-$64(a5)
bra L292
L290
; else if (ctx->Color.BlendEquation==GL_FUNC_REVERSE_SUBTRACT
move.l $21F6(a2),d0
cmp.l #$800B,d0
bne L292
L291
; r = Rd * dR - Rs * sR;
fmove.l d7,fp0
fmove.s fp0,-$58(a5)
fmove.s -$58(a5),fp0
fmul.x fp7,fp0
fmove.s fp0,-$58(a5)
fmove.l -$18(a5),fp0
fmul.x fp6,fp0
fmove.s -$58(a5),fp1
fsub.x fp0,fp1
fmove.s fp1,-$58(a5)
; g = Gd * dG - Gs * sG;
fmove.l d6,fp0
fmove.s fp0,-$5C(a5)
fmove.s -$5C(a5),fp0
fmul.s -$4C(a5),fp0
fmove.s fp0,-$5C(a5)
fmove.l -$1C(a5),fp0
fmul.s -$3C(a5),fp0
fmove.s -$5C(a5),fp1
fsub.x fp0,fp1
fmove.s fp1,-$5C(a5)
; b = Bd * dB - Bs * sB;
fmove.l d5,fp0
fmove.s fp0,-$60(a5)
fmove.s -$60(a5),fp0
fmul.x fp4,fp0
fmove.s fp0,-$60(a5)
fmove.l -$20(a5),fp0
fmul.x fp2,fp0
fmove.s -$60(a5),fp1
fsub.x fp0,fp1
fmove.s fp1,-$60(a5)
; a = Ad * dA - As * sA;
fmove.l d3,fp0
fmove.s fp0,-$64(a5)
fmove.s -$64(a5),fp0
fmul.x fp5,fp0
fmove.s fp0,-$64(a5)
fmove.l d4,fp0
fmul.x fp3,fp0
fmove.s -$64(a5),fp1
fsub.x fp0,fp1
fmove.s fp1,-$64(a5)
L292
; rgba[i][RCOMP] = (GLint) CLAMP( r, 0.0F, 255.0F );
fmove.s -$58(a5),fp0
fcmp.s #$.00000000,fp0
fboge.b L294
L293
fmove.s #$.00000000,fp0
bra.b L298
L294
fmove.s -$58(a5),fp0
fcmp.s #$.437F0000,fp0
fbole.b L296
L295
fmove.s #$.437F0000,fp0
bra.b L297
L296
fmove.s -$58(a5),fp0
L297
L298
fmove.l fp0,d0
move.b d0,0(a3,d2.l*4)
; rgba[i][GCOMP] = (GLint) CLAMP( g, 0.0F, 255.0F );
fmove.s -$5C(a5),fp0
fcmp.s #$.00000000,fp0
fboge.b L300
L299
fmove.s #$.00000000,fp0
bra.b L304
L300
fmove.s -$5C(a5),fp0
fcmp.s #$.437F0000,fp0
fbole.b L302
L301
fmove.s #$.437F0000,fp0
bra.b L303
L302
fmove.s -$5C(a5),fp0
L303
L304
fmove.l fp0,d0
lea 0(a3,d2.l*4),a0
move.b d0,1(a0)
; rgba[i][BCOMP] = (GLint) CLAMP( b, 0.0F, 255.0F );
fmove.s -$60(a5),fp0
fcmp.s #$.00000000,fp0
fboge.b L306
L305
fmove.s #$.00000000,fp0
bra.b L310
L306
fmove.s -$60(a5),fp0
fcmp.s #$.437F0000,fp0
fbole.b L308
L307
fmove.s #$.437F0000,fp0
bra.b L309
L308
fmove.s -$60(a5),fp0
L309
L310
fmove.l fp0,d0
lea 0(a3,d2.l*4),a0
move.b d0,2(a0)
; rgba[i][ACOMP] = (GLint) CLAMP( a, 0.0F, 255.0F );
fmove.s -$64(a5),fp0
fcmp.s #$.00000000,fp0
fboge.b L312
L311
fmove.s #$.00000000,fp0
bra.b L316
L312
fmove.s -$64(a5),fp0
fcmp.s #$.437F0000,fp0
fbole.b L314
L313
fmove.s #$.437F0000,fp0
bra.b L315
L314
fmove.s -$64(a5),fp0
L315
L316
fmove.l fp0,d0
lea 0(a3,d2.l*4),a0
move.b d0,3(a0)
L317
addq.l #1,d2
L318
cmp.l $C(a5),d2
blo L237
L319
fmovem.x (a7)+,fp2/fp3/fp4/fp5/fp6/fp7
movem.l (a7)+,d2-d7/a2-a4
unlk a5
rts
L235
dc.b 'Bad blend dest factor in do_blend',0
L234
dc.b 'Bad blend source factor in do_blend',0
SECTION "_set_blend_function:0",CODE
;static void set_blend_function(GLcontext *ctx)
_set_blend_function
move.l d2,-(a7)
move.l $8(a7),a0
L330
; GLenum eq = ctx->Color.BlendEquation;
move.l $21F6(a0),d0
; GLenum src = ctx->Color.BlendSrc;
move.l $21EE(a0),d2
; GLenum dst = ctx->Color.BlendDst;
move.l $21F2(a0),d1
; if (eq==GL_FUNC_ADD_EXT && src==GL_SRC_ALPHA && dst==GL_ONE_MI
cmp.l #$8006,d0
bne.b L334
L331
cmp.l #$302,d2
bne.b L334
L332
cmp.l #$303,d1
bne.b L334
L333
; ctx->Color.BlendFunc = blend_transparency;
move.l #_blend_transparency,$220A(a0)
bra L352
L334
; else if (eq==GL_FUNC_ADD_EXT && src==GL_ONE && dst==GL_ON
cmp.l #$8006,d0
bne.b L338
L335
cmp.l #1,d2
bne.b L338
L336
cmp.l #1,d1
bne.b L338
L337
; ctx->Color.BlendFunc = blend_add;
move.l #_blend_add,$220A(a0)
bra.b L352
L338
;
cmp.l #$8006,d0
beq.b L340
L339
cmp.l #$800B,d0
bne.b L342
L340
tst.l d2
bne.b L342
L341
cmp.l #$300,d1
beq.b L346
L342
cmp.l #$8006,d0
beq.b L344
L343
cmp.l #$800A,d0
bne.b L347
L344
cmp.l #$306,d2
bne.b L347
L345
tst.l d1
bne.b L347
L346
; ctx->Color.BlendFunc = blend_modulate;
move.l #_blend_modulate,$220A(a0)
bra.b L352
L347
; else if (eq==GL_MIN_EXT)
cmp.l #$8007,d0
bne.b L349
L348
; ctx->Color.BlendFunc = blend_min;
move.l #_blend_min,$220A(a0)
bra.b L352
L349
; else if (eq==GL_MAX_EXT)
cmp.l #$8008,d0
bne.b L351
L350
; ctx->Color.BlendFunc = blend_max;
move.l #_blend_max,$220A(a0)
bra.b L352
L351
; ctx->Color.BlendFunc = blend_general;
move.l #_blend_general,$220A(a0)
L352
move.l (a7)+,d2
rts
SECTION "_gl_blend_span:0",CODE
;void gl_blend_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
XDEF _gl_blend_span
_gl_blend_span
L359 EQU -$1900
link a5,#L359
movem.l d2/d3/a2-a4,-(a7)
movem.l $10(a5),d1/d3/a4
move.l $C(a5),d2
move.l $8(a5),a2
move.l $1C(a5),a3
L353
; if (ctx->Color.BlendEquation==GL_LOGIC_OP && !ctx->Color.SWLog
move.l $21F6(a2),d0
cmp.l #$BF1,d0
bne.b L356
L354
tst.b $2214(a2)
bne.b L356
L355
movem.l (a7)+,d2/d3/a2-a4
unlk a5
rts
L356
; gl_read_rgba_span( ctx, n, x, y, dest );
pea -$1900(a5)
move.l d3,-(a7)
move.l d1,-(a7)
move.l d2,-(a7)
move.l a2,-(a7)
jsr _gl_read_rgba_span
add.w #$14,a7
; if (!ctx->Color.BlendFunc)
tst.l $220A(a2)
bne.b L358
L357
; set_blend_function(ctx);
move.l a2,-(a7)
jsr _set_blend_function
addq.w #4,a7
L358
; (*ctx->Color.BlendFunc)( ctx, n, mask, rgba, (CONST GLubyte(*)
pea -$1900(a5)
move.l a4,-(a7)
move.l a3,-(a7)
move.l d2,-(a7)
move.l a2,-(a7)
move.l $220A(a2),a0
jsr (a0)
add.w #$14,a7
movem.l (a7)+,d2/d3/a2-a4
unlk a5
rts
SECTION "_gl_blend_pixels:0",CODE
;void gl_blend_pixels( GLcontext *ctx,
XDEF _gl_blend_pixels
_gl_blend_pixels
L371 EQU -$4B04
link a5,#L371
movem.l d2/a2-a4,-(a7)
movem.l $C(a5),d2/a4
move.l $8(a5),a2
move.l $1C(a5),a3
L360
; if (ctx->Color.BlendEquation==GL_LOGIC_OP && !ctx->Color.SWLog
move.l $21F6(a2),d0
cmp.l #$BF1,d0
bne.b L363
L361
tst.b $2214(a2)
bne.b L363
L362
movem.l (a7)+,d2/a2-a4
unlk a5
rts
L363
; (*ctx->Driver.ReadRGBAPixels)( ctx, n, x, y, dest, mask );
move.l a3,-(a7)
pea -$4B00(a5)
move.l $14(a5),-(a7)
move.l a4,-(a7)
move.l d2,-(a7)
move.l a2,-(a7)
move.l $958(a2),a0
jsr (a0)
add.w #$18,a7
; if (ctx->RasterMask & ALPHABUF_BIT)
move.l a2,a0
add.l #$E974,a0
move.l (a0),d0
and.l #$100,d0
beq.b L365
L364
; gl_read_alpha_pixels( ctx, n, x, y, dest, mask );
move.l a3,-(a7)
pea -$4B00(a5)
move.l $14(a5),-(a7)
move.l a4,-(a7)
move.l d2,-(a7)
move.l a2,-(a7)
jsr _gl_read_alpha_pixels
add.w #$18,a7
bra.b L368
L365
; for (i=0;
moveq #0,d0
bra.b L367
L366
; dest[i][ACOMP] = 255;
lea -$4B00(a5),a0
lea 0(a0,d0.l*4),a0
move.b #$FF,3(a0)
addq.l #1,d0
L367
cmp.l d2,d0
blo.b L366
L368
; if (!ctx->Color.BlendFunc)
tst.l $220A(a2)
bne.b L370
L369
; set_blend_function(ctx);
move.l a2,-(a7)
jsr _set_blend_function
addq.w #4,a7
L370
; (*ctx->Color.BlendFunc)( ctx, n, mask, rgba, (CONST GLubyte(*)
pea -$4B00(a5)
move.l $18(a5),-(a7)
move.l a3,-(a7)
move.l d2,-(a7)
move.l a2,-(a7)
move.l $220A(a2),a0
jsr (a0)
add.w #$14,a7
movem.l (a7)+,d2/a2-a4
unlk a5
rts
END